package com.cgnpc.scp.common.service;

import cn.com.cgnpc.aep.bizcenter.appcenter.sdk.client.RestClient;
import cn.com.cgnpc.aep.bizcenter.appcenter.sdk.config.Constants;
import cn.com.cgnpc.aep.bizcenter.appcenter.sdk.result.ApiResult;
import cn.com.cgnpc.aep.bizcenter.appcenter.sdk.vo.CgnRequestHeader;
import cn.com.cgnpc.aep.bizcenter.filecenter.api.vo.FileUrlVO;
import cn.com.cgnpc.aep.bizcenter.filecenter.api.vo.UploadBaseInfoVO;
import com.cgnpc.cud.boot.autoconfigure.aep.AepProperties;
import com.cgnpc.cuddemo.utils.IDHelper;
import com.cgnpc.framework.userinfo.CurrentUser;
import com.cgnpc.framework.utils.CgnHeader;
import com.cgnpc.scp.common.bean.ScpAepProperties;
import com.cgnpc.scp.common.bean.ScpApiResult;
import com.cgnpc.scp.common.bean.ScpFileInfoVO;
import com.cgnpc.scp.common.mybatis.entity.ScpCommonFileUpload;
import com.cgnpc.scp.common.pojo.UserInfo;
import com.cgnpc.scp.common.utils.DateUtil;
import com.cgnpc.scp.common.utils.JacksonUtil;
import com.cgnpc.scp.common.utils.ListUtil;
import com.cgnpc.scp.common.utils.NumberUtil;
import com.cgnpc.scp.common.utils.StringUtil;
import org.apache.commons.beanutils.BeanUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

/**
 * 上传文件服务类
 */
@Service
public class FileCenterService {
    private static final Logger LOGGER = LoggerFactory.getLogger(FileCenterService.class);

    @Autowired
    private MessageSource messageSource;

    @Autowired
    private RestClient restClient;

    @Autowired
    private AepProperties aepProperties;

    @Autowired
    private ScpAepProperties scpAepProperties;

    @Autowired
    private CurrentUser currentUser;

    @Autowired
    private IScpCommonFileUploadService scpCommonFileUploadService;

    /**
     * 创建UploadBaseInfoVO对象<br>
     *
     * @param loginUserInfo
     * @param usedAepProperties
     * @param usedScpAepProperties
     */
    public static UploadBaseInfoVO createUploadBaseInfoVO(
            UserInfo loginUserInfo,
            AepProperties usedAepProperties,
            ScpAepProperties usedScpAepProperties
    ) {
        UploadBaseInfoVO uploadBaseInfoVO = new UploadBaseInfoVO();
        uploadBaseInfoVO.setTenantIdParam(usedAepProperties.getTenantId());
        uploadBaseInfoVO.setTenantCode(usedAepProperties.getTenantCode());
        uploadBaseInfoVO.setTenantName(usedAepProperties.getTenantName());
        uploadBaseInfoVO.setAppIdParam(usedScpAepProperties.getAppIdParam());
        uploadBaseInfoVO.setAppCode(usedAepProperties.getAppCode());
        uploadBaseInfoVO.setAppName(usedAepProperties.getAppName());
        uploadBaseInfoVO.setUploadUserId("1");
        uploadBaseInfoVO.setUploadUserCode(loginUserInfo.getUserId());
        uploadBaseInfoVO.setUploadUserName(loginUserInfo.getUserName());
        return uploadBaseInfoVO;
    }

    /**
     * 上传文件到中台<br>
     * ###请注意：原来上传代码并没有返回ApiResult的泛型；建议转成json字符串，再转成Map使用；<br>
     *
     * @param reqLocale 语言
     * @param fileList  文件列表
     * @return 上传结果
     * @throws Exception Exception
     * @see #uploadFileToFileCenterWithScpApiResult(String, Locale, UserInfo, List)
     */
    protected ApiResult uploadFileToFileCenterManager(
            final String logInfo,
            Locale reqLocale,
            UserInfo loginUserInfo,
            List<MultipartFile> fileList
    ) throws Exception {
        boolean reqHeaderPrintDebugInfo = false;
        final List<Object> uploadFileResultList = null;
        final List<Object> uploadFileDebugInfoList = null;
        return uploadFileToFileCenterManager(
                logInfo,
                reqLocale,
                loginUserInfo,
                fileList,
                reqHeaderPrintDebugInfo,
                uploadFileResultList,
                uploadFileDebugInfoList
        );
    }

    protected ApiResult uploadFileToFileCenterManager(
            final String logInfo,
            Locale reqLocale,
            UserInfo loginUserInfo,
            List<MultipartFile> fileList,
            final boolean reqHeaderPrintDebugInfo,
            final List<Object> uploadFileResultList,
            final List<Object> uploadFileDebugInfoList
    ) throws Exception {
        // 测试环境实际返回值：
        //{
        //    "responseId": "1",
        //    "code": "200",
        //    "msg": "成功",
        //    "data": [
        //        {
        //            "status": true,
        //            "msg": "成功",
        //            "tenantId": "1",
        //            "appId": "1260840145154740225",
        //            "appName": "智能调试一体化平台",
        //            "fileId": "1316276450856275969",
        //            "fileName": "getBpmPscActInfoResponse.json",
        //            "fileType": "json",
        //            "fileSize": "493",
        //            "url": "http://aep-fastdfs1-t.gnpjvc.cgnpc.com.cn:8888/group2/M00/08/9C/CmQYEl-GpZeAd3P4AAAB7foW9U026.json",
        //            "downloadCount": null,
        //            "previewCount": null,
        //            "uploadUserCode": "P622400",
        //            "uploadUserName": "why ",
        //            "uploadTime": "2020-10-14 15:15:35",
        //            "fileStatus": "正常"
        //        },
        //        {
        //            "status": true,
        //            "msg": "成功",
        //            "tenantId": "1",
        //            "appId": "1260840145154740225",
        //            "appName": "智能调试一体化平台",
        //            "fileId": "1316276450914996225",
        //            "fileName": "getPermissions_response.json",
        //            "fileType": "json",
        //            "fileSize": "404",
        //            "url": "http://aep-fastdfs1-t.gnpjvc.cgnpc.com.cn:8888/group2/M00/08/84/CmQYD1-GpZeATSd_AAABlIA_QVk45.json",
        //            "downloadCount": null,
        //            "previewCount": null,
        //            "uploadUserCode": "P622400",
        //            "uploadUserName": "why ",
        //            "uploadTime": "2020-10-14 15:15:35",
        //            "fileStatus": "正常"
        //        }
        //    ]
        //}

        // final String logInfo = "[uploadFileToCenterManager_UUID_" + UUID.randomUUID().toString() + "]";
        ApiResult result = null;

        try {
            if (ListUtil.getListSizeWith0(fileList) <= 0) {
                // 需要一个或多个文件
                ApiResult apiResult = ApiResult.fail("failId");
                apiResult.setMsg("上传的文件数量必须大于0");
                return apiResult;
            }

            // begin 测试中台的文件上传微服务
            AepProperties usedAepProperties = aepProperties;
            ScpAepProperties usedScpAepProperties = scpAepProperties;

            if (reqHeaderPrintDebugInfo && uploadFileDebugInfoList != null) {
                uploadFileDebugInfoList.add("usedAepProperties:[" + JacksonUtil.writeValueAsString(usedAepProperties) + "]；");
                uploadFileDebugInfoList.add("usedScpAepProperties:[" + JacksonUtil.writeValueAsString(usedScpAepProperties) + "]；");
            }

            UploadBaseInfoVO uploadBaseInfoVO = createUploadBaseInfoVO(loginUserInfo, usedAepProperties, usedScpAepProperties);

            if (reqHeaderPrintDebugInfo && uploadFileDebugInfoList != null) {
                uploadFileDebugInfoList.add("uploadBaseInfoVO:[" + JacksonUtil.writeValueAsString(uploadBaseInfoVO) + "]；");
            }

            // realServiceUrl可能为fileCenter的uploadFiles操作，不要改变该名称
            final String realServiceUrl = Constants.FILECENTER_URL + "/uploadFiles";
            String url = CgnHeader.getUrl(usedAepProperties.getActive()) + realServiceUrl;
            LOGGER.info("{}url:{};", logInfo, url);

            if (reqHeaderPrintDebugInfo && uploadFileDebugInfoList != null) {
                uploadFileDebugInfoList.add("url:[" + url + "]；");
            }

            CgnRequestHeader header = CgnHeader.getHeader(realServiceUrl, usedAepProperties);

            if (reqHeaderPrintDebugInfo && uploadFileDebugInfoList != null) {
                uploadFileDebugInfoList.add("header:[" + JacksonUtil.writeValueAsString(header) + "]；");
            }

            // 调用远程接口
            result = restClient.postCgnFileForRest(url, uploadBaseInfoVO, header, fileList);

            if ("".length() >= 1000) {
                // 开发环境可以启用该配置
                result = this.test_getLocalTestUploadApiResult();
            }

            if (reqHeaderPrintDebugInfo && uploadFileDebugInfoList != null) {
                uploadFileDebugInfoList.add("result:[" + JacksonUtil.writeValueAsString(result) + "]；");
            }

            // fileMap 是什么？？？
            // result = restClient.postCgnFileForRest(url, fileMap, header, multipartFiles);

            // end 测试中台的文件上传微服务
        } catch (Exception e) {
            LOGGER.error("{}uploadFileToCenterManager.error;", logInfo, e);
            throw e;
        }

        return result;
    }

    public ScpApiResult<List<ScpFileInfoVO>> uploadFileToFileCenterWithScpApiResult(
            final String logInfo,
            Locale reqLocale,
            UserInfo loginUserInfo,
            List<MultipartFile> fileList
    ) throws Exception {
        final boolean reqHeaderPrintDebugInfo = false;
        final List<Object> uploadFileResultList = null;
        final List<Object> uploadFileDebugInfoList = null;
        return uploadFileToFileCenterWithScpApiResult(
                logInfo
                , reqLocale
                , loginUserInfo
                , fileList
                , reqHeaderPrintDebugInfo
                , uploadFileResultList
                , uploadFileDebugInfoList
        );
    }

    /**
     * 上传文件到中台文件服务器<br>
     * 该方法会保存上传文件信息到表tbl_common_fileupload<br>
     *
     * @param logInfo                 日志uuid
     * @param reqLocale               请求的语言类型
     * @param loginUserInfo           登录人信息
     * @param fileList                上传的文件列表
     * @param reqHeaderPrintDebugInfo 是否打印调试信息
     * @param uploadFileResultList    上传文件的结果
     * @param uploadFileDebugInfoList 上传文件的调试信息
     * @return 上传文件信息
     * @throws Exception error
     */
    public ScpApiResult<List<ScpFileInfoVO>> uploadFileToFileCenterWithScpApiResult(
            final String logInfo,
            Locale reqLocale,
            UserInfo loginUserInfo,
            List<MultipartFile> fileList,
            final boolean reqHeaderPrintDebugInfo,
            final List<Object> uploadFileResultList,
            final List<Object> uploadFileDebugInfoList
    ) throws Exception {
        // begin 获取登录人信息
        String loginUserInfoUserId = null;
        String loginUserInfoUserName = null;

        if (loginUserInfo != null) {
            loginUserInfoUserId = loginUserInfo.getUserId();
            loginUserInfoUserName = loginUserInfo.getUserName();
        }
        // end 获取登录人信息

        if (ListUtil.getListSizeWith0(fileList) <= 0) {
            // 增加判断，如果上传文件数量小于等于0，则返回提示
            ScpApiResult<List<ScpFileInfoVO>> scpApiResult = new ScpApiResult<>();
            scpApiResult.setResponseId("failId");
            scpApiResult.setCode("500");
            scpApiResult.setMsg("上传的文件数量必须大于0");
            return scpApiResult;
        }

        ApiResult apiResult = this.uploadFileToFileCenterManager(
                logInfo
                , reqLocale
                , loginUserInfo
                , fileList
                , reqHeaderPrintDebugInfo
                , uploadFileResultList
                , uploadFileDebugInfoList
        );

        ScpApiResult<List<ScpFileInfoVO>> scpApiResult = parseApiResultToScpApiResult(apiResult);

        if (scpApiResult != null) {
            List<ScpFileInfoVO> resultFileInfoVOList = scpApiResult.getData();

            if (resultFileInfoVOList != null) {
                List<ScpCommonFileUpload> usedScpCommonFileUpload = new ArrayList<>();
                ScpCommonFileUpload scpCommonFileUpload = null;
                Date nowDate = new Date();
                SimpleDateFormat sdfYyyymmddHhmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                SimpleDateFormat sdfYyyymmdd = new SimpleDateFormat("yyyy-MM-dd");

                for (ScpFileInfoVO resultFileInfoVO : resultFileInfoVOList) {
                    String usedId = IDHelper.uuidNew();
                    resultFileInfoVO.setScpCommonFileUploadId(usedId);

                    scpCommonFileUpload = new ScpCommonFileUpload();
                    usedScpCommonFileUpload.add(scpCommonFileUpload);
                    scpCommonFileUpload.setId(usedId);
                    scpCommonFileUpload.setFileCenterTenantId(resultFileInfoVO.getTenantId());
                    scpCommonFileUpload.setFileCenterAppId(resultFileInfoVO.getAppId());
                    scpCommonFileUpload.setFileCenterAppName(resultFileInfoVO.getAppName());
                    scpCommonFileUpload.setFileCenterFileId(NumberUtil.formatLongToString(resultFileInfoVO.getFileId()));
                    scpCommonFileUpload.setFileCenterFileName(resultFileInfoVO.getFileName());
                    scpCommonFileUpload.setFileCenterFileType(resultFileInfoVO.getFileType());
                    scpCommonFileUpload.setFileCenterFileSize(NumberUtil.parseStringToLongWithNull(resultFileInfoVO.getFileSize()));
                    scpCommonFileUpload.setFileCenterUrl(resultFileInfoVO.getUrl());
                    scpCommonFileUpload.setFileCenterUploadUserCode(resultFileInfoVO.getUploadUserCode());
                    scpCommonFileUpload.setFileCenterUploadUserName(resultFileInfoVO.getUploadUserName());
                    scpCommonFileUpload.setFileCenterUploadTime(DateUtil.parseToDateWithNullNotError(sdfYyyymmddHhmmss, sdfYyyymmdd, resultFileInfoVO.getUploadTime()));
                    scpCommonFileUpload.setFileCenterFileStatus(resultFileInfoVO.getFileStatus());
                    scpCommonFileUpload.setCreateTime(nowDate);
                    scpCommonFileUpload.setCreateUser(loginUserInfoUserId);
                    scpCommonFileUpload.setCreateUserName(loginUserInfoUserName);
                    scpCommonFileUpload.setLastUpdateTime(nowDate);
                    scpCommonFileUpload.setLastUpdateUserName(loginUserInfoUserId);
                    scpCommonFileUpload.setLastUpdateUserName(loginUserInfoUserName);
                }

                scpCommonFileUploadService.save(loginUserInfo, reqLocale, usedScpCommonFileUpload);
            }
        }

        return scpApiResult;
    }

    public ApiResult test_getLocalTestUploadApiResult() {
        String strJson = "{\n" +
                "    \"responseId\": \"1\",\n" +
                "    \"code\": \"200\",\n" +
                "    \"msg\": \"成功\",\n" +
                "    \"data\": [\n" +
                "        {\n" +
                "            \"status\": true,\n" +
                "            \"msg\": \"成功\",\n" +
                "            \"tenantId\": \"1\",\n" +
                "            \"appId\": \"1260840145154740225\",\n" +
                "            \"appName\": \"智能调试一体化平台\",\n" +
                "            \"fileId\": \"1316276450856275969\",\n" +
                "            \"fileName\": \"getBpmPscActInfoResponse.json\",\n" +
                "            \"fileType\": \"json\",\n" +
                "            \"fileSize\": \"493\",\n" +
                "            \"url\": \"http://aep-fastdfs1-t.gnpjvc.cgnpc.com.cn:8888/group2/M00/08/9C/CmQYEl-GpZeAd3P4AAAB7foW9U026.json\",\n" +
                "            \"downloadCount\": null,\n" +
                "            \"previewCount\": null,\n" +
                "            \"uploadUserCode\": \"P622400\",\n" +
                "            \"uploadUserName\": \"why \",\n" +
                "            \"uploadTime\": \"2020-10-14 15:15:35\",\n" +
                "            \"fileStatus\": \"正常\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"status\": true,\n" +
                "            \"msg\": \"成功\",\n" +
                "            \"tenantId\": \"1\",\n" +
                "            \"appId\": \"1260840145154740225\",\n" +
                "            \"appName\": \"智能调试一体化平台\",\n" +
                "            \"fileId\": \"1316276450914996225\",\n" +
                "            \"fileName\": \"getPermissions_response.json\",\n" +
                "            \"fileType\": \"json\",\n" +
                "            \"fileSize\": \"404\",\n" +
                "            \"url\": \"http://aep-fastdfs1-t.gnpjvc.cgnpc.com.cn:8888/group2/M00/08/84/CmQYD1-GpZeATSd_AAABlIA_QVk45.json\",\n" +
                "            \"downloadCount\": null,\n" +
                "            \"previewCount\": null,\n" +
                "            \"uploadUserCode\": \"P622400\",\n" +
                "            \"uploadUserName\": \"why \",\n" +
                "            \"uploadTime\": \"2020-10-14 15:15:35\",\n" +
                "            \"fileStatus\": \"正常\"\n" +
                "        }\n" +
                "    ]\n" +
                "}\n";

        return JacksonUtil.readValue(strJson, ApiResult.class);
    }

    public ScpApiResult<List<FileUrlVO>> getUrlFromFileCenterManager(
            UserInfo loginUserInfo,
            List<String> reqFileIdList
    ) throws Exception {
        final boolean reqHeaderPrintDebugInfo = false;
        final List<Object> uploadFileDebugInfoList = null;
        return getUrlFromFileCenterManager(
                loginUserInfo
                , reqFileIdList
                , reqHeaderPrintDebugInfo
                , uploadFileDebugInfoList
        );
    }

    public ScpApiResult<List<FileUrlVO>> getUrlFromFileCenterManager(
            UserInfo loginUserInfo,
            List<String> reqFileCenterFileIdList,
            final boolean reqHeaderPrintDebugInfo,
            final List<Object> downloadFileDebugInfoList
    ) throws Exception {
        final String logInfo = "[getUrlFromFileCenterManager_UUID_" + UUID.randomUUID().toString() + "]";
        ScpApiResult<List<FileUrlVO>> apiResult = null;

        try {
            if (ListUtil.getListSizeWith0(reqFileCenterFileIdList) <= 0) {
                return null;
            }

            // 文件id，ids，多个id用英文逗号,隔开
            String sbReqIds = "";

            for (String reqFileCenterFileId : reqFileCenterFileIdList) {
                if (!StringUtil.isNullOrSpace(reqFileCenterFileId)) {
                    sbReqIds += reqFileCenterFileId.trim() + ",";
                }
            }

            if (sbReqIds.length() <= 0) {
                return null;
            }

            while (sbReqIds.endsWith(",")) {
                sbReqIds = sbReqIds.substring(0, sbReqIds.length() - 1);
            }

            AepProperties usedAepProperties = aepProperties;

            // 获取文件URL
            // realServiceUrl可能为fileCenter的uploadFiles操作，不要改变该名称
            String realServiceUrl = Constants.FILECENTER_URL + "/getUrls";
            String fileCenterFullUrl = CgnHeader.getUrl(usedAepProperties.getActive()) + realServiceUrl;
            LOGGER.info("{}fileCenterFullUrl:{};", logInfo, fileCenterFullUrl);

            if (reqHeaderPrintDebugInfo && downloadFileDebugInfoList != null) {
                downloadFileDebugInfoList.add("usedAepProperties:" + JacksonUtil.writeValueAsString(usedAepProperties));
                downloadFileDebugInfoList.add("fileCenterFullUrl:" + fileCenterFullUrl);
            }

            CgnRequestHeader cgnRequestHeader = CgnHeader.getHeader(realServiceUrl, usedAepProperties);

            if (reqHeaderPrintDebugInfo && downloadFileDebugInfoList != null) {
                downloadFileDebugInfoList.add("cgnRequestHeader: " + JacksonUtil.writeValueAsString(cgnRequestHeader));
            }

            Map<String, Object> uriVariablesMap = new HashMap<>();
            uriVariablesMap.put("ids", sbReqIds);
            ApiResult apiResultWithSrc = restClient.postCgnMapForRest(fileCenterFullUrl, cgnRequestHeader, uriVariablesMap);

            if ("".length() >= 1000) {
                apiResultWithSrc = test_getUrls();
            }

            if (reqHeaderPrintDebugInfo && downloadFileDebugInfoList != null) {
                downloadFileDebugInfoList.add("uriVariablesMap: " + JacksonUtil.writeValueAsString(uriVariablesMap));
                downloadFileDebugInfoList.add("apiResultWithSrc: " + JacksonUtil.writeValueAsString(apiResultWithSrc));
            }

            if (apiResultWithSrc != null) {
                apiResult = new ScpApiResult<>();
                apiResult.setResponseId(apiResultWithSrc.getResponseId());
                apiResult.setCode(apiResultWithSrc.getCode());
                apiResult.setMsg(apiResultWithSrc.getMsg());

                Object apiResultWithSrcData = apiResultWithSrc.getData();
                apiResult.setDataSrc(apiResultWithSrcData);

                if (apiResultWithSrcData instanceof List) {
                    List apiResultWithSrcDataList = (List) apiResultWithSrcData;
                    List<FileUrlVO> fileUrlVODataList = new ArrayList<>();

                    for (Object apiResultWithSrcDataListItem : apiResultWithSrcDataList) {
                        FileUrlVO fileUrlVOData = new FileUrlVO();
                        fileUrlVODataList.add(fileUrlVOData);
                        BeanUtils.copyProperties(fileUrlVOData, apiResultWithSrcDataListItem);
                    }

                    apiResult.setData(fileUrlVODataList);
                }
            }
        } catch (Exception e) {
            LOGGER.error("{}error;", logInfo, e);
            throw e;
        }

        return apiResult;
    }

    public static ScpApiResult<List<ScpFileInfoVO>> parseApiResultToScpApiResult(ApiResult apiResult) {
        if (apiResult == null) {
            return null;
        }

        try {
            Object apiResultData = apiResult.getData();

            ScpApiResult<List<ScpFileInfoVO>> scpApiResult = new ScpApiResult<>();

            scpApiResult.setResponseId(apiResult.getResponseId());
            scpApiResult.setCode(apiResult.getCode());
            scpApiResult.setMsg(apiResult.getMsg());
            scpApiResult.setDataSrc(apiResultData);

            if (apiResultData instanceof List) {
                List apiResultDataList = (List) apiResultData;
                List<ScpFileInfoVO> usedFileInfoVOList = new ArrayList<>();

                for (Object apiResultDataListItem : apiResultDataList) {
                    ScpFileInfoVO fileInfoVO = new ScpFileInfoVO();
                    BeanUtils.copyProperties(fileInfoVO, apiResultDataListItem);
                    usedFileInfoVOList.add(fileInfoVO);
                }

                scpApiResult.setData(usedFileInfoVOList);
            }

            return scpApiResult;
        } catch (Exception e) {
            LOGGER.error("parseApiResultToScpApiResult.error;", e);
            throw new RuntimeException(e);
        }
    }

    private ApiResult test_getUrls() {
        String strResultInfo = "{\n" +
                "    \"responseId\": \"75d2543e24aa4f0880fead5e2aa55b41\",\n" +
                "    \"code\": \"200\",\n" +
                "    \"msg\": \"成功；fileCenterFullUrl:http://aepgw-t.gnpjvc.cgnpc.com.cn/filecenter/getUrls；header:{\\\"requestId\\\":\\\"75d2543e24aa4f0880fead5e2aa55b41\\\",\\\"version\\\":\\\"v1.0\\\",\\\"tenantId\\\":\\\"1\\\",\\\"userId\\\":\\\"P622400\\\",\\\"appId\\\":\\\"SWP-SU\\\",\\\"appKey\\\":\\\"112a13c4a6794e90954319e291fda8c1\\\",\\\"appMethod\\\":\\\"/filecenter/getUrls\\\",\\\"timestamp\\\":\\\"1603185602673\\\",\\\"format\\\":\\\"json\\\",\\\"signInfo\\\":\\\"3ddce60a8c8da5c7d55bdefad98d8777\\\",\\\"accessToken\\\":null}；usedAepProperties:{\\\"active\\\":\\\"test\\\",\\\"tenantId\\\":\\\"1\\\",\\\"tenantCode\\\":\\\"CGNP\\\",\\\"tenantName\\\":\\\"中国广核电力股份有限公司\\\",\\\"appId\\\":\\\"SWP-SU\\\",\\\"appCode\\\":\\\"SWP-SU\\\",\\\"appName\\\":\\\"智能调试一体化平台\\\",\\\"appKey\\\":\\\"112a13c4a6794e90954319e291fda8c1\\\",\\\"appSecret\\\":\\\"fddb69044293432e9d3fe1937c9b26de\\\"}；uriVariablesMap:{\\\"ids\\\":\\\"1317145059631566849,1317145059648344066\\\"}；\",\n" +
                "    \"data\": [\n" +
                "        {\n" +
                "            \"fileId\": \"1317145059648344066\",\n" +
                "            \"fileName\": \"test-测试下载用的-eclipse-jee-2019-12-R-linux-gtk-x86_64.tar.gz\",\n" +
                "            \"fileUrl\": \"http://localhost/eclipse-jee-2019-12-R-linux-gtk-x86_64.tar.gz?token=078d7d825561dc2254ce37ff4fcad2e8&ts=1603185354&filename=scp用户菜单相关.postman_collection.json\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"fileId\": \"1317145059631566849\",\n" +
                "            \"fileName\": \"cud_scp-yblrs.postman_collection.json\",\n" +
                "            \"fileUrl\": \"http://aep-fastdfs1-t.gnpjvc.cgnpc.com.cn:8888/group2/M00/08/9A/CmQYD1-JzoyAAMeOAAEgCzgU3sw79.json?token=a0646ca89a6875fe83a750a759749962&ts=1603185354&filename=cud_scp-yblrs.postman_collection.json\"\n" +
                "        }\n" +
                "    ]\n" +
                "}";

        return JacksonUtil.readValue(strResultInfo, ApiResult.class);
    }

}
